using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;

namespace Janus.NorthwindDemo2007
{
	public partial class ContactDashboardView
	{

		public override Janus.NorthwindDemo2007.FolderView[] GetDefinedViews()
		{
			return new FolderView[] {new FolderView("Northwind Contacts", ContentViewType.DashBoard, "")};

		}

		private void explorerBar_ItemClick(object sender, Janus.Windows.ExplorerBar.ItemEventArgs e)
		{
			switch (e.Item.Key)
			{
				case "NewCustomer":
					NewItem("Customers");
					break;
				case "GoToCustomers":
					GoToFolder("Customers");
					break;
				case "NewSupplier":
					NewItem("Suppliers");
					break;
				case "GoToSuppliers":
					GoToFolder("Suppliers");
					break;
				case "NewEmployee":
					NewItem("Employees");
					break;
				case "GoToEmployees":
					GoToFolder("Employees");
					break;
			}
		}
		private void GoToFolder(string folderName)
		{
			ApplicationFolder folder = null;
			folder = NorthwindApp.RootFolder.Find(folderName);
			if (folder != null)
			{
				NorthwindApp.MainForm.CurrentFolder = folder;
			}
		}
		private void NewItem(string foldername)
		{
			ApplicationFolder folder = null;
			folder = NorthwindApp.RootFolder.Find(foldername);
			if (folder != null)
			{
				folder.AddNew();
			}
		}

        private void ribbon1_CommandClick(object sender, Janus.Windows.Ribbon.CommandEventArgs e)
        {

            switch (e.Command.Key)
            {
                case "rcmdCustomers":
                    GoToFolder("Customers");
                    break;
                case "rcmdSuppliers":
                    GoToFolder("Suppliers");
                    break;
                case "rcmdEmployees":
                    GoToFolder("Employees");
                    break;
            }
        }


	}

} //end of root namespace